package com.example.yiwei.crm.view.frament.JDCoorFragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ImageView;

import com.example.yiwei.crm.R;
import com.example.yiwei.crm.entity.CoorSeacherVisitActivity;
import com.example.yiwei.crm.view.Class.gridViewClass.MyGridView;
import com.example.yiwei.crm.view.Class.gridViewClass.QuertGridAdapter;
import com.example.yiwei.crm.view.activity.JYCoordingActivity.JYSearchAppointmentActivity;
import com.example.yiwei.crm.view.activity.JYCoordingActivity.JYSearchCoordingActivity;
import com.example.yiwei.crm.view.activity.JYCoordingActivity.JYSearchJLActivity;
import com.example.yiwei.crm.view.activity.JYCoordingActivity.JYSearchSHActivity;
import com.example.yiwei.crm.view.activity.JYCoordingActivity.JYSearchVisitActivity;
import com.example.yiwei.crm.view.activity.JYCoordingActivity.SearchJDActivity;
import com.example.yiwei.crm.view.activity.JYCoordingActivity.SimpleUseCarActivity;
import com.example.yiwei.crm.view.activity.coordinationActivity.CoorSeacherCommActivity;
import com.example.yiwei.crm.view.activity.coordinationActivity.CoordingAppointmentSearchActivity;
import com.example.yiwei.crm.view.activity.coordinationActivity.CoordingCustomerSearchActivity;
import com.example.yiwei.crm.view.activity.coordinationActivity.SeacherCustomerActivity;
import com.example.yiwei.crm.view.activity.coordinationActivity.SeacherJLActivity;
import com.example.yiwei.crm.view.activity.coordinationActivity.SeacherMYDActivity;
import com.example.yiwei.crm.view.activity.coordinationActivity.SearchCoordinationActivity;

/**
 * Created by Administrator on 2017/6/26.
 */

public class QueryFragment extends Fragment {
    private MyGridView gridview;
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View rootview=inflater.inflate(R.layout.query_fragment,container,false);
        gridview=(MyGridView)rootview.findViewById(R.id.gridview);

        gridview.setAdapter(new QuertGridAdapter(getActivity()));
        gridview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
               switch (position){
                   case 0:
                       //查询合作客户
                       Intent intent=new Intent(getActivity(), JYSearchCoordingActivity.class);
                       startActivity(intent);
                       break;
                   case 1:
                       //查询拜访记录
                       Intent intent1=new Intent(getActivity(), JYSearchVisitActivity.class);
                       intent1.putExtra("tag2","k2");
                       startActivity(intent1);
                       break;
                   case 2:
                       //查询交流记录
                       Intent intent2=new Intent(getActivity(), JYSearchJLActivity.class);
                       intent2.putExtra("tag3","k3");
                       startActivity(intent2);
                       break;
                   case 3:
                       //查询客户记录
                       Intent intent3=new Intent(getActivity(), SeacherCustomerActivity.class);
                       intent3.putExtra("tag4","k4");
                       startActivity(intent3);
                       break;
                   case 4:
                       //查询预约记录
                       Intent intent5=new Intent(getActivity(), JYSearchAppointmentActivity.class);
                       intent5.putExtra("tag5","k5");
                       startActivity(intent5);
                       break;
                   case 5:
                       //查询审核记录
                       Intent intent4=new Intent(getActivity(),JYSearchSHActivity.class);
                       intent4.putExtra("tag6","k6");
                       startActivity(intent4);
                       break;
                   case 6:
                       //申请用车记录
                       Intent intent6=new Intent(getActivity(),SimpleUseCarActivity.class);
                       intent6.putExtra("tag7","k7");
                       startActivity(intent6);

               }
            }
        });
        return rootview;
    }

}
